1. Technical Field
The present invention relates in general to data storage on disk storage media and in particular to error handling and recovery for disk storage media. Still more particularly, the present invention relates to distinguishing true write errors during error handling and recovery for disk storage media.
2. Description of the Related Art
Accurate and prompt reporting of write errors or faults a disk drive by device drivers, adapters, and/or disk drives when an attempted write to the hard disk drive is unsuccessful represents the ideal situation for data protection. Under these conditions, the system or user application has an opportunity to preserve the data by writing it elsewhere. In particular, write faults indicating failure of an attempted write to a disk sectorxe2x80x94which is indicative, in turn, of the unreliability of that disk sectorxe2x80x94must be accurate for the operating system to preserve the user data.
However, there exist no standard means for reporting a write error due to sector failure to the operating system.
Different device drivers from various vendors will report different errors for this circumstance, ranging from the preferable write fault to a totally unreliable xe2x80x9cdrive malfunctionxe2x80x9d error. With this array of error reporting seen by the operating system, there is a need for an effective mechanism allowing the operating system to distinguish between true write faults from other errors which might be returned.
It would be desirable, therefore, to provide mechanism for distinguishing true write faults, resulting from disk sector failure, from other errors which might be returned during an attempted write to disk storage.
It is therefore one object of the present invention to provide improved data storage on disk storage media.
It is another object of the present invention to provide improved error handling and recovery for disk storage media.
It is yet another object of the present invention to provide a mechanism for distinguishing true write errors during error handling and recovery for disk storage media.
The foregoing objects are achieved as is now described. If necessary, problematic sectors are isolated when an attempt to write a group of data blocks to corresponding disk sectors returns a write error by attempting to write each data sector individually, registering each individual sector which returns a write error for separate, further examination. Since disk drive vendors do not employ consistent write error messages in device drivers, true write faultsxe2x80x94those caused by failure of disk media such that a sector becomes unreliable or unrecoverablexe2x80x94are then identified by an operating system device manager for the disk drive by writing the data block to a reserved replacement sector and monitoring the status of that write. If the write to the replacement sector also fails with a write error, the error signaled likely indicates a true drive status and an appropriate error is returned to the file system which issued the write request. If the write to the replacement sector succeeds, however, the write error most likely reflects a failing sector. Relocation of the failing may then be completed by simply mapping the original data sector to the replacement sector, and marking the original data sector as bad.
The above as well as additional objects, features, and advantages of the present invention will become apparent in the following detailed written description.